import React from 'react'
import ReactDOM from 'react-dom'
import App from './route'
import './style/index.less'
import { BrowserRouter as Router } from 'react-router-dom'
import { ConfigProvider, Empty } from 'antd'
import zh_CN from 'antd/lib/locale/zh_CN'
import { Provider } from 'react-redux'
import store from '@/store/index'
import IphoneApp from './iPhoneRoute'

const ComponentApp = /Android|webOS|iPhone|iPod|BlackBerry/i.test(
  window.navigator.userAgent
)
  ? IphoneApp
  : App

ReactDOM.render(
  <Provider store={store}>
    <ConfigProvider
      prefixCls="wh"
      locale={zh_CN}
      renderEmpty={() => {
        return <Empty description={'No Data'} />
      }}
    >
      <Router>
        <ComponentApp />
      </Router>
    </ConfigProvider>
  </Provider>,
  document.querySelector('#root')
)
